﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;

namespace Bon_It.Model
{
    using Bon_It.Resources;

    public partial class Warengruppe : Entity<Warengruppe>
    {

        /// <summary>
        /// Attach the property changed method from the base class.
        /// </summary>
        partial void OnCreated()
        {
            PropertyChanged += OnPropertyChanged;
        }
        public override string this[string columnName]
        {
            get
            {
                switch (columnName)
                {
                    case "Bezeichnung":
                        if (string.IsNullOrWhiteSpace(Bezeichnung))
                        {
                            return ErrorResources.ComodityGroupNameIsMissing;
                        }
                        break;
                }
                return base[columnName];
            }
        }

        public override string Error
        {
            get
            {
                if (!string.IsNullOrEmpty(this["Bezeichnung"]))
                {
                    return "error";
                }
                return string.Empty;
            }
        }

    }
}
